/**
 * 
 */
package com.sci.web.action.lefttree;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Menu;
import com.sci.web.bean.Permission;

/**
 * @author  BaiFuyou
 * @date: Sep 22, 2011 5:15:13 PM
 * 
 * 创新型试点企业申报菜单
 */
public class CxxsdqysbTreeAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2411185070311455851L;
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		List<Menu> menu = new ArrayList<Menu>();
		Menu sdqysb = new Menu("sdqysb","试点企业申报",true,"partSMLModeing_sml","试点企业申报");
		Menu sdqycs = new Menu("sdqycs","试点企业初审",true,"smlmanage","试点企业初审");
		Menu sdqyzs = new Menu("sdqyzs","试点企业终审",true,"smlmanage","试点企业终审");
		Menu sdqyshjl = new Menu("sdqyshjl","试点企业审核记录",true,"smlmanage","试点企业审核记录");
		Permission p = (Permission) ActionContext.getContext().getSession().get("permission");
		int uc = (Integer) ActionContext.getContext().getSession().get("uc");
		int ur = (Integer) ActionContext.getContext().getSession().get("ur");
		if(uc == -1 && ur ==  -1){
			menu.add(sdqysb);
			menu.add(sdqycs);
			menu.add(sdqyzs);
			menu.add(sdqyshjl);
			String json = super.getJSONArrayString(menu);
			super.setContentType(BaseAction.JSON);
			super.outPrint(json);
			return "json";
		}
		if(p.getSdqysb() == 1){
			menu.add(sdqysb);
		}
		if(p.getSdqycs() == 1){
			menu.add(sdqycs);
		}
		if(p.getSdqyzs() == 1){
			menu.add(sdqyzs);
		}
		if(p.getSdqyshjl() == 1){
			menu.add(sdqyshjl);
		}
		String json = super.getJSONArrayString(menu);
		super.setContentType(BaseAction.JSON);
		super.outPrint(json);
		return "json";
		
		
	}
	
}
